#include <cstdio>

using namespace std;

#define N 10000001

int tree[N];
int sum_num[N];

int find_root(int x);

int main(int argc, char const *argv[]) {
    int n;
    while (scanf("%d", &n) != EOF) {
        for (int i = 1; i < N; ++i) {
            tree[i] = -1;
            sum_num[i] = 1;
        }
        for (int i = 0; i < n; ++i) {
            int a, b;
            scanf("%d%d", &a, &b);
            a = find_root(a);
            b = find_root(b);
            if (a != b) {
                tree[a] = b;
                sum_num[b] += sum_num[a];
            }
        }
        int result = 1; //at least 1
        for (int i = 1; i <= N; ++i) {
            if (tree[i] == -1 && sum_num[i] > result)
                result = sum_num[i];
        }
        printf("%d\n", result);
    }
    return 0;
}

int find_root(int x) {
    if (tree[x] == -1)
        return x;
    else {
        int temp_index = find_root(tree[x]);
        tree[x] = temp_index;
        return temp_index;
    }
}